RISC-V /Debug /Access Memory

Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text

Interpret as Access Memory

31 2827 2423 2019 1615 1211 87 43 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0target-specific 0 (arg0)write 0 (aampostincrement)aampostincrement 0 (8bit)aamsize 0 (physical)aamvirtual 0cmdtype

aamsize=8bit, write=arg0, aamvirtual=physical

Description

This command lets the debugger perform memory accesses, with the exact same memory view and permissions as performing loads/stores on the selected hart. This includes access to hart-local memory-mapped registers, etc. The command performs the following sequence of operations:

  1. Copy data from the memory location specified in arg1 into the arg0 portion of data, if {accessregister-write} is clear.
  2. Copy data from the arg0 portion of data into the memory location specified in arg1, if {accessregister-write} is set.
  3. If {accessmemory-aampostincrement} is set, increment arg1.

If any of these operations fail, {abstractcs-cmderr} is set and none of the remaining steps are executed. An access may only fail if the hart, running M-mode code, might encounter that same failure when it attempts the same access. An implementation may detect an upcoming failure early, and fail the overall command before it reaches the step that would cause failure.

Debug Modules may optionally implement this command and may support read and write access to memory locations when the selected hart is running or halted. If this command supports memory accesses while the hart is running, it must also support memory accesses while the hart is halted.

đź“Ś NOTE

The encoding of {accessmemory-aamsize} was chosen to match {sbcs-sbaccess} in {dm-sbcs}.

This command modifies arg0 only when memory is read. It modifies arg1 only if {accessmemory-aampostincrement} is set. The other data registers are not changed.

Fields

target-specific

These bits are reserved for target-specific uses.

write

0 (arg0): Copy data from the memory location specified in arg1 into the low bits of arg0. The value of the remaining bits of arg0 are UNSPECIFIED.

1 (memory): Copy data from the low bits of arg0 into the memory location specified in arg1.

aampostincrement

After a memory access has completed, if this bit is 1, increment arg1 (which contains the address used) by the number of bytes encoded in {accessmemory-aamsize}.

Supporting this variant is optional, but highly recommended for performance reasons.

aamsize

0 (8bit): Access the lowest 8 bits of the memory location.

1 (16bit): Access the lowest 16 bits of the memory location.

2 (32bit): Access the lowest 32 bits of the memory location.

3 (64bit): Access the lowest 64 bits of the memory location.

4 (128bit): Access the lowest 128 bits of the memory location.

aamvirtual

An implementation does not have to implement both virtual and physical accesses, but it must fail accesses that it doesn’t support.

0 (physical): Addresses are physical (to the hart they are performed on).

1 (virtual): Addresses are virtual, and translated the way they would be from M-mode, with MPRV set.

cmdtype

This is 2 to indicate Access Memory Command.

Links

() ()